import React from 'react';
import { format } from '@/utils/datetime';
import CommonPage from '@/components/page/CommonPage';
const daoName = 'CompAccoPl';
const importName = 'CompAccoPl';
const columns: API.Column[] = [
  {
    title: '组织机构号',
    width: 150,
    sorter: true,
    dataIndex: 'ENCD',
    key: 'ENCD',
    dispaly: true,
    filter: true,
    export: true,
  },
  {
    title: '账号',
    width: 200,
    sorter: true,
    export: true,
    dataIndex: 'ACNO',
    key: 'ACNO',
    dispaly: true,
    filter: true,
  },
  {
    title: '子账号',
    width: 120,
    sorter: true,
    export: true,
    dataIndex: 'BANO',
    key: 'BANO',
    dispaly: true,
    filter: true,
  },
  {
    title: '客户名称',
    width: 260,
    sorter: true,
    dataIndex: 'KHMC',
    key: 'KHMC',
    dispaly: true,
    filter: true,
    export: true,
  },
  {
    title: '分户日期',
    width: 120,
    sorter: true,
    key: 'DSDT',
    caption: 'DSDT',
    render: (data) => format(data, 'yyyy-MM-dd'),
    export: true,
    dispaly: true,
    filter: true,
  },
  {
    title: '员工工号1',
    width: 140,
    sorter: true,
    key: 'EMNO1',
    dataIndex: 'EMNO1',
    dispaly: true,
    filter: true,
    export: true,
  },
  {
    title: '分成比例1(%)',
    width: 150,
    sorter: true,
    key: 'ZB1',
    dataIndex: 'ZB1',
    dispaly: true,
    filter: true,
    export: true,
  },
  {
    title: '员工工号2',
    width: 140,
    sorter: true,
    key: 'EMNO2',
    dataIndex: 'EMNO2',
    dispaly: true,
    filter: true,
    export: true,
  },
  {
    title: '分成比例2(%)',
    width: 150,
    sorter: true,
    key: 'ZB2',
    dataIndex: 'ZB2',
    dispaly: true,
    filter: true,
    export: true,
  },
  {
    title: '员工工号3',
    width: 140,
    sorter: true,
    key: 'EMNO3',
    dataIndex: 'EMNO3',
    dispaly: true,
    filter: true,
    export: true,
  },
  {
    title: '分成比例3(%)',
    width: 150,
    sorter: true,
    dataIndex: 'ZB3',
    key: 'ZB3',
    dispaly: true,
    filter: true,
    canEdit: false,
    export: true,
  },
  {
    title: '员工工号4',
    width: 140,
    sorter: true,
    key: 'EMNO4',
    dataIndex: 'EMNO4',
    dispaly: true,
    filter: true,
    export: true,
  },
  {
    title: '分成比例4(%)',
    width: 150,
    sorter: true,
    dataIndex: 'ZB4',
    key: 'ZB4',
    dispaly: true,
    filter: true,
    canEdit: false,
    export: true,
  },
  {
    title: '员工工号5',
    width: 140,
    sorter: true,
    key: 'EMNO5',
    dataIndex: 'EMNO5',
    dispaly: true,
    filter: true,
    export: true,
  },
  {
    title: '分成比例5(%)',
    width: 150,
    sorter: true,
    dataIndex: 'ZB5',
    key: 'ZB5',
    dispaly: true,
    filter: true,
    canEdit: false,
    export: true,
  },
  {
    title: '员工工号6',
    width: 140,
    sorter: true,
    key: 'EMNO6',
    dataIndex: 'EMNO6',
    dispaly: true,
    filter: true,
    export: true,
  },
  {
    title: '分成比例6(%)',
    width: 150,
    sorter: true,
    dataIndex: 'ZB6',
    key: 'ZB6',
    dispaly: true,
    filter: true,
    canEdit: false,
    export: true,
  },
  {
    title: '员工工号7',
    width: 140,
    sorter: true,
    key: 'EMNO7',
    dataIndex: 'EMNO7',
    dispaly: true,
    filter: true,
    export: true,
  },
  {
    title: '分成比例7(%)',
    width: 150,
    sorter: true,
    dataIndex: 'ZB7',
    key: 'ZB7',
    dispaly: true,
    filter: true,
    canEdit: false,
    export: true,
  },
  {
    title: '员工工号8',
    width: 140,
    sorter: true,
    key: 'EMNO8',
    dataIndex: 'EMNO8',
    dispaly: true,
    filter: true,
    export: true,
  },
  {
    title: '分成比例8(%)',
    width: 150,
    sorter: true,
    dataIndex: 'ZB8',
    key: 'ZB8',
    dispaly: true,
    filter: true,
    canEdit: false,
    export: true,
  },
  {
    title: '员工工号9',
    width: 140,
    sorter: true,
    key: 'EMNO9',
    dataIndex: 'EMNO9',
    dispaly: true,
    filter: true,
    export: true,
  },
  {
    title: '分成比例9(%)',
    width: 150,
    sorter: true,
    dataIndex: 'ZB9',
    key: 'ZB9',
    dispaly: true,
    filter: true,
    canEdit: false,
    export: true,
  },
  {
    title: '员工工号10',
    width: 140,
    sorter: true,
    key: 'EMNO10',
    dataIndex: 'EMNO10',
    dispaly: true,
    filter: true,
    export: true,
  },
  {
    title: '分成比例10(%)',
    width: 160,
    sorter: true,
    dataIndex: 'ZB10',
    key: 'ZB10',
    dispaly: true,
    filter: true,
    canEdit: false,
    export: true,
  },
];
const controls: API.Control[] = [
  {
    name: 'ENCD',
    rules: [
      { required: false, message: '不能为空' },
      { min: 1, max: 50, message: '最小为1，最大为50' },
    ],
    type: 'text',
    label: '组织机构号',
    grid: 12 / 24,
  },
  {
    name: 'ACNO',
    rules: [
      { required: false, message: '不能为空' },
      { min: 1, max: 50, message: '最小为1，最大为50' },
    ],
    type: 'text',
    label: '账号',
    grid: 12 / 24,
  },
  {
    name: 'BANO',
    rules: [
      { required: false, message: '不能为空' },
      { min: 1, max: 50, message: '最小为1，最大为50' },
    ],
    type: 'text',
    label: '子账号',
    grid: 12 / 24,
  },
  {
    name: 'KHMC',
    rules: [
      { required: true, message: '不能为空' },
      { min: 1, max: 50, message: '最小为1，最大为50' },
    ],
    type: 'text',
    label: '客户名称',
    grid: 12 / 24,
  },
  {
    name: 'DSDT',
    rules: [
      { required: true, message: '不能为空' },
      { min: 1, max: 50, message: '最小为1，最大为50' },
    ],
    type: 'date',
    label: '分户日期',
    dataType: 'date',
    grid: 12 / 24,
    placeholder: '请选择分户日期...',
  },
  {
    name: 'EMNO1',
    rules: [{ required: true, message: '不能为空' }],
    type: 'text',
    label: '员工工号1',
    grid: 12 / 24,
  },
  {
    name: 'ZB1',
    rules: [
      { required: true, message: '不能为空' },
      { min: 1, max: 50, message: '最小为1，最大为50' },
    ],
    type: 'number',
    label: '分成比例1(%)',
    dataType: 'number',
    grid: 12 / 24,
  },
  {
    name: 'EMNO2',
    rules: [
      { required: false, message: '不能为空' },
      { min: 1, max: 50, message: '最小为1，最大为50' },
    ],
    type: 'text',
    label: '员工工号2',
    grid: 12 / 24,
  },
  {
    name: 'ZB2',
    rules: [
      { required: false, message: '不能为空' },
      { min: 1, max: 50, message: '最小为1，最大为50' },
    ],
    type: 'number',
    label: '分成比例2(%)',
    dataType: 'number',
    grid: 12 / 24,
  },
  {
    name: 'EMNO3',
    rules: [{ required: false, message: '不能为空' }],
    type: 'text',
    label: '员工工号3',
    grid: 12 / 24,
  },
  {
    name: 'ZB3',
    rules: [{ required: false, message: '不能为空' }],
    type: 'number',
    label: '分成比例3(%)',
    dataType: 'number',
    grid: 12 / 24,
  },
  {
    name: 'EMNO4',
    rules: [{ required: false, message: '不能为空' }],
    type: 'text',
    label: '员工工号4',
    grid: 12 / 24,
  },
  {
    name: 'ZB4',
    rules: [{ required: false, message: '不能为空' }],
    type: 'number',
    label: '分成比例4(%)',
    dataType: 'number',
    grid: 12 / 24,
  },
  {
    name: 'EMNO5',
    rules: [{ required: false, message: '不能为空' }],
    type: 'text',
    label: '员工工号5',
    grid: 12 / 24,
  },
  {
    name: 'ZB5',
    rules: [{ required: false, message: '不能为空' }],
    type: 'number',
    label: '分成比例5(%)',
    dataType: 'number',
    grid: 12 / 24,
  },
  {
    name: 'EMNO6',
    rules: [{ required: false, message: '不能为空' }],
    type: 'text',
    label: '员工工号6',
    grid: 12 / 24,
  },
  {
    name: 'ZB6',
    rules: [{ required: false, message: '不能为空' }],
    type: 'number',
    label: '分成比例6(%)',
    dataType: 'number',
    grid: 12 / 24,
  },
  {
    name: 'EMNO7',
    rules: [{ required: false, message: '不能为空' }],
    type: 'text',
    label: '员工工号7',
    grid: 12 / 24,
  },
  {
    name: 'ZB7',
    rules: [{ required: false, message: '不能为空' }],
    type: 'number',
    label: '分成比例7(%)',
    dataType: 'number',
    grid: 12 / 24,
  },
  {
    name: 'EMNO8',
    rules: [{ required: false, message: '不能为空' }],
    type: 'text',
    label: '员工工号8',
    grid: 12 / 24,
  },
  {
    name: 'ZB8',
    rules: [{ required: false, message: '不能为空' }],
    type: 'number',
    label: '分成比例8(%)',
    dataType: 'number',
    grid: 12 / 24,
  },
  {
    name: 'EMNO9',
    rules: [{ required: false, message: '不能为空' }],
    type: 'text',
    label: '员工工号9',
    grid: 12 / 24,
  },
  {
    name: 'ZB9',
    rules: [{ required: false, message: '不能为空' }],
    type: 'number',
    label: '分成比例9(%)',
    dataType: 'number',
    grid: 12 / 24,
  },
  {
    name: 'EMNO10',
    rules: [{ required: false, message: '不能为空' }],
    type: 'text',
    label: '员工工号10',
    grid: 12 / 24,
  },
  {
    name: 'ZB10',
    rules: [{ required: false, message: '不能为空' }],
    type: 'number',
    label: '分成比例10(%)',
    dataType: 'number',
    grid: 12 / 24,
  },
];
const CompAccoPlForm: React.FC = () => {
  return (
    <CommonPage
      daoName={daoName}
      columns={columns}
      controls={controls}
      title="对公贷款批量"
      importName={importName}
      importControls={controls}
      importMode="TruncteAfterInsert"
      importTemplateName="对公存贷款批量"
      initSorter={{ FieldName: 'ACNO', Direction: 'DESC' }}
    />
  );
};

export default CompAccoPlForm;
